import type {Loader} from "../../../framework/Loder.ts";
import type {World} from "../../../framework/World.ts";

const loadListeners: ((loader: Loader, world: World)=>void)[] = []

loadListeners.push((loader: Loader, world: World):void=>{})

export const getLoadListener = ():(loader: Loader, world: World)=>void => {
    return loadListeners[0]
}

export const setLoadListener = (h:(loader: Loader, world: World)=>void): void => {
    if (loadListeners.length > 0) {
        loadListeners[0] = h
    }
}
